import express from 'express'
import cors from 'cors'

const app = express()

app.use(cors())

app.get('/api/:id', (req, res) => {
  res.json({
    name: 'pipi',
    email: '123@qq.com',
    username: 'pipi',
    phone: '1234567890',
    website: 'https://www.baidu.com',
    id: req.params.id
  })
})

app.listen(3000, () => {
  console.log('listen at http://localhost:3000')
})